<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2021/6/26
  Time: 18:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="wy" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>学生数据</title>
</head>
<link rel="stylesheet" href="../css/stumsg.css">
</style>
<body>
    <table>
        <tr>
            <td>学生编号</td>
            <td>姓名</td>
            <td>年龄</td>
            <td>性别</td>
        </tr>
        <wy:forEach items="${pageData.datelist}" var="p">
            <tr>
                <td>${p.s_id}</td>
                <td>${p.s_name}</td>
                <td>${p.s_age}</td>
                <td>${p.s_gender?'男':'女'}</td>
            </tr>
        </wy:forEach>
    </table>
    <div id="pageBox">
        <div class="fe">
            <a href="/SelectStudentServlet?cid=${cid}&cpage=${1}">首页</a>
        </div>
        <div class="fe">
            <a href="/SelectStudentServlet?cid=${cid}&cpage=${pageData.curpage-1>0?pageData.curpage-1:1}">上页</a>
        </div>
        <wy:forEach begin="${pageData.curpage>2?pageData.curpage-2:1}"
                    end="${pageData.curpage<pageData.maxpage-2?pageData.curpage+2:pageData.maxpage}" var="num" step="1">

            <a href="/SelectStudentServlet?cid=${cid}&cpage=${num}" style="${pageData.curpage==num?'background-color: blueviolet':''}" >${num}</a>
        </wy:forEach>

        <div class="fe">
            <a href="/SelectStudentServlet?cid=${cid}
            &cpage=${pageData.curpage+1<pageData.maxpage?pageData.curpage+1:pageData.maxpage}">下页</a>
        </div>
        <div class="fe">
            <a href="/SelectStudentServlet?cid=${cid}&cpage=${pageData.maxpage}">尾页</a>
        </div>
    </div>
</body>
</html>
